<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>MyConcerts</title>
<link href="css/default.css" rel="stylesheet" type="text/css" />
</head>

<body>
<?php
//Set debug level
//error_reporting(E_ALL);
//Include our mysql functions
include("mysql.php");
//Temporarily we set the $_SESSION variable
$_SESSION['username'] = "Martin8412";
//We connect to the DB
connectdb();
//Read the username from our session
$username = $_SESSION['username'];

//Get the ID of the user using the username
$id = mysql_fetch_array(mysql_query("SELECT id FROM users WHERE username=\"".$username."\""));

//We count the amount of PM's for a certain user
$NewPmCount = mysql_num_rows(mysql_query("SELECT message FROM pms WHERE id=\"".$id['id']."\" AND read1=0"));

//Echo rest of the html
echo '<div id="Wrapper">
<div class="MainDim" id="UserLogin">Welcome <a href="user.php?id='.$id[0].'">'.$username.'</a> (Admin) <a href="messages.php">.'.$NewPmCount.'</a> unread PM! </div>

<div class="MainDim" id="Banner">This space is reserved for a banner/slideshow for upcoming events.</div>

<div class="MainDim" id="MainMenu">

<a href="index.php">Frontpage</a><br>
<a href="profile.php">Profile</a><br>
<a href="MyConcerts.php">My Concerts</a><br>
<a href="search.php">Search</a><br>
<a href="logout.php">Logout</a><br>

</div>

<div class="MainDim" id="Content">All the content goes here</div>

<div class="MainDim" id="Footer">Copyright © 2010</div>
</div>
</body>
</html>'
?>
